
package gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Observable;
import java.util.Observer;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;

import model.Model;
import model.NotifyPicassa;

/**
 * @author Troy Ferrell
 *
 */
public class PromptFrame extends PicassaFrame
{
	private PicassaObservable myObservable;
	
	private JTextArea myPromptField;
	
	private static final int PADDING = 10;
	
	public PromptFrame(Model newModel)
	{
		setModel(newModel);
		myObservable = new PicassaObservable();
	
		this.getContentPane().add( createPrompt());
	}
	
	/**
	 * Create components for prompt of system
	 * 
	 * @return Container for prompt
	 */
	private JComponent createPrompt()
	{
		myPromptField = new JTextArea("PICASSA");
		myPromptField.setEditable(false);
		myPromptField.setBackground(Color.LIGHT_GRAY);
		myPromptField.setBorder(new EmptyBorder(PADDING, PADDING, PADDING, PADDING));
		
		NotifyPicassa.setPrompt(myPromptField);
		
		JScrollPane promptScrollPane = new JScrollPane(myPromptField);
		promptScrollPane.setPreferredSize(new Dimension(100, 140));
		promptScrollPane.setBorder( BorderFactory.createTitledBorder( 
				BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "PICASSA Prompt"));
		
		return promptScrollPane;
	}
}
